<template>
	<view class="content">
		<u-navbar
			:title="title" 
			:bg-color="`${mainColor}`" 
			fixed 
			placeholder 
			autoBack
			:height="navigationBarHeight"
			:title-style="{color:`${textColor}`, fontSize:'16px', fontWeight:700}"
			:left-icon-color="`${textColor}`"
			v-if="showTitle"
			/>
		<view style="padding: 20px 20px;">
			<rich-text :nodes="content"></rich-text>
		</view>
	</view>
</template>

<script>
	import { systemInfo } from '@/utils/mixin';
	import { getAgreement } from '@/api';

	export default {
		mixins: [systemInfo],
		data() {
			return {
				title: '',
				content: ''
			}
		},
		onLoad({type, title}) {
			this.title = title;
			// #ifdef MP-ALIPAY
			my.setNavigationBar({
			    title
			})
			// #endif
			this.getSystemInfo();
			this.loadAgreement(type)
		},
		methods: {
			async loadAgreement(type) {
				const res = await getAgreement(type);
				this.content = res.data.content;
			}
		}
	}
</script>

<style>

</style>
